package Basic.day03.homework;

import java.util.Scanner;

public class HomeWork03 {
    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            Scanner sc = new Scanner(System.in);
            String score = sc.next();
            if (score.matches("[0-9]+") //正则匹配，确保输入的是数字
                    && Integer.parseInt(score) >= 0
                    && Integer.parseInt(score) <= 150) {
                if (Integer.parseInt(score) < 60) {
                    System.out.println("成绩等级为：D");
                } else if (Integer.parseInt(score) >= 60 && Integer.parseInt(score) < 80) {
                    System.out.println("成绩等级为：C");
                } else if (Integer.parseInt(score) >= 80 && Integer.parseInt(score) < 90) {
                    System.out.println("成绩等级为：B");
                } else if (Integer.parseInt(score) >= 90) {
                    System.out.println("成绩等级为：A");
                }
            } else {
                System.out.println("成绩不合法");
            }
        }
    }
}
